<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
        .text-container {
            width: 200px;
            overflow: hidden;
        }

        .multiline-text {
            display: -webkit-box;
            /*? 设置一个元素是水平还是垂直布局其内容*/
            -webkit-box-orient: vertical;
            /*? 可以把块容器中的内容限制为指定的行数*/
            -webkit-line-clamp: 3;
            overflow: hidden;
            /*? 用于确定如何提示用户存在隐藏的溢出内容 ellipsis为显示省略号*/
            text-overflow: ellipsis;
        }
    </style>
</head>
<body>
<div class="text-container">
    <p class="multiline-text">
        This is a long text that needs to be truncated if it exceeds multiple lines.
    </p>
</div>
</body>
</html>
